package com.sen.patterns.creational.builder.ex2;

import java.util.Arrays;
import java.util.List;

import junit.framework.TestCase;

public class Test extends TestCase {

	private List input = Arrays.asList(new PartItem[] { new Engine("Engine"),
			new Carriage("Carriage"), new Tyre("Tyre") });
	
	
	public void testCar() {
		AutoBuilder builder = new CarBuilder();
		AutomobileDirector director = new AutomobileDirector(builder);
		Automobile car = director.produceAuto(input);
		System.out.println(car);
	}
	
	public void testBus() {
		AutoBuilder builder = new BusBuilder();
		AutomobileDirector director = new AutomobileDirector(builder);
		Automobile bus = director.produceAuto(input);
		System.out.println(bus);
	}
	
	public void testTruck() {
		AutoBuilder builder = new TruckBuilder();
		AutomobileDirector director = new AutomobileDirector(builder);
		Automobile truck = director.produceAuto(input);
		System.out.println(truck);
	}
	
}
